/*
 * @(#)JwiStemmer.java	1.0 08/01/07
 *
 * Copyright 2007 Fabio Gasparetti. All rights reserved.
 */

package org.tabularium.text.nlp;

import java.util.Set;

import org.tabularium.text.nlp.wordnet.jwi.JwiPartOfSpeech;
import org.tabularium.text.nlp.wordnet.PartOfSpeech;

import edu.mit.jwi.morph.SimpleStemmer;

/**
 * Stemmer based on WordNet stemming algorithm.
 * <p>
 * See {@link http://wordnet.princeton.edu/man/morphy.7WN.html}
 * 
 * @author Fabio Gasparetti
 * @version 1.0, 08/01/07
 */

public class JwiStemmer implements Stemmer {
	protected SimpleStemmer stemmer = null; 
	
	public Set getRoots(String word, int pos) {
		return stemmer.getRoots(word, JwiPartOfSpeech.translate(pos));		
	}

	public Set getRoots(String word) {
		return stemmer.getRoots(word);
	}

	public JwiStemmer() {
		stemmer = new SimpleStemmer();
	}
}
